-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Purchasing: fixed consumable purchases by fixing transaction-finishing #1965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small things but looks good.
2e80400
to
0699e18
Compare
0699e18
to
d4b5d98
Compare
Integration Tests
: added tests for purchasing consumable productsde32618
to
61f6317
Compare
This is ready for review now. |
61f6317
to
fc37cd8
Compare
|
||
self.finishTransactionIfNeeded(transaction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was out of order.
66d3982
to
0a7b5a6
Compare
|
||
func testCanPurchaseConsumableMultipleTimes() async throws { | ||
// See https://revenuecats.atlassian.net/browse/TRIAGE-134 | ||
try XCTSkipIf(Self.storeKit2Setting == .disabled, "This test is not currently passing on SK1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed [TRIAGE-136] for this.
fc37cd8
to
436be58
Compare
The second test reproduces #1964.
436be58
to
1002300
Compare
### Changes: - Greatly increased test coverage for `StoreKit2TransactionListener` - Extracted `AsyncSequence.extractValues` - Created `MockStoreTransaction` to be able to mock and verify `finish()` calls - Simplified `StoreKit2TransactionListener`, moved `finish` call to `PurchasesOrchestrator` - Follow up to #1965, also finish SK2 transactions from `StoreKit.Transaction.updates`
Fixes #1964, TRIAGE-134, TRIAGE-131, and possibly TRIAGE-82.
Depends on #1967, #1968.
Fixes:
SK2
purchases we were never finishing transactions. We are now.SK1
purchases, transactions were finished after the completion block was invoked (and tests were very lenient checking that eventually this happened). This could have lead to race conditions.SKTestSession
s), this fixes the ability to purchase multiple consumable purchases.This is the log from the failing test using SK2:
Open
With the fix, you can see transactions are now finished at the right time:
Open